//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.qst.crop.security.entity;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

public class JwtUser implements UserDetails {
    private String username;
    private String nickname;
    private String password;
    private String avatar;
    private Collection<? extends GrantedAuthority> authorities;

    public JwtUser(String username, String nickname, String password, String avatar, Collection<? extends GrantedAuthority> authorities) {
        this.username = username;
        this.nickname = nickname;
        this.password = password;
        this.avatar = avatar;
        this.authorities = authorities;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public String getNickname() {
        return this.nickname;
    }

    public String getUsername() {
        return this.username;
    }

    public boolean isAccountNonExpired() {
        return true;
    }

    public boolean isAccountNonLocked() {
        return true;
    }

    public boolean isCredentialsNonExpired() {
        return true;
    }

    public boolean isEnabled() {
        return true;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Collection<? extends GrantedAuthority> getAuthorities() {
        return this.authorities;
    }

    public void setAuthorities(Collection<? extends GrantedAuthority> authorities) {
        this.authorities = authorities;
    }

    public void setNickname(final String nickname) {
        this.nickname = nickname;
    }

    public void setAvatar(final String avatar) {
        this.avatar = avatar;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof JwtUser)) {
            return false;
        } else {
            JwtUser other = (JwtUser)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label71: {
                    Object this$username = this.getUsername();
                    Object other$username = other.getUsername();
                    if (this$username == null) {
                        if (other$username == null) {
                            break label71;
                        }
                    } else if (this$username.equals(other$username)) {
                        break label71;
                    }

                    return false;
                }

                Object this$nickname = this.getNickname();
                Object other$nickname = other.getNickname();
                if (this$nickname == null) {
                    if (other$nickname != null) {
                        return false;
                    }
                } else if (!this$nickname.equals(other$nickname)) {
                    return false;
                }

                label57: {
                    Object this$password = this.getPassword();
                    Object other$password = other.getPassword();
                    if (this$password == null) {
                        if (other$password == null) {
                            break label57;
                        }
                    } else if (this$password.equals(other$password)) {
                        break label57;
                    }

                    return false;
                }

                Object this$avatar = this.getAvatar();
                Object other$avatar = other.getAvatar();
                if (this$avatar == null) {
                    if (other$avatar != null) {
                        return false;
                    }
                } else if (!this$avatar.equals(other$avatar)) {
                    return false;
                }

                Object this$authorities = this.getAuthorities();
                Object other$authorities = other.getAuthorities();
                if (this$authorities == null) {
                    if (other$authorities == null) {
                        return true;
                    }
                } else if (this$authorities.equals(other$authorities)) {
                    return true;
                }

                return false;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof JwtUser;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $username = this.getUsername();
        result = result * 59 + ($username == null ? 43 : $username.hashCode());
        Object $nickname = this.getNickname();
        result = result * 59 + ($nickname == null ? 43 : $nickname.hashCode());
        Object $password = this.getPassword();
        result = result * 59 + ($password == null ? 43 : $password.hashCode());
        Object $avatar = this.getAvatar();
        result = result * 59 + ($avatar == null ? 43 : $avatar.hashCode());
        Object $authorities = this.getAuthorities();
        result = result * 59 + ($authorities == null ? 43 : $authorities.hashCode());
        return result;
    }

    public String toString() {
        return "JwtUser(username=" + this.getUsername() + ", nickname=" + this.getNickname() + ", password=" + this.getPassword() + ", avatar=" + this.getAvatar() + ", authorities=" + this.getAuthorities() + ")";
    }
}
